//头文件algorithm中定义了一个名为count的函数，它类似find，接受一对迭代器和一个值作为参数。
//count返回给定值在序列中出现的次数。编写程序，读取int序列存入vector中，打印有多少个元素的值等于给定值。
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;

namespace mystd
{
	template <class T, class B>
	int count(B a, B b, T c) {
		int val = 0;
		while (a != b) {
			if (*a == c)
				val++;
			a++;
		}
		return val;
	}
}
int main()
{
	cout << "input how many integrite num u will input " << endl;
	vector<int>vec;
	int i = 0,val=0;
	cin >> i;
	for(i;i>0;i--)
	{
		cout << "input num" << endl;
		cin >> val;
		vec.push_back(val);
	}
	vector<int>::iterator it = vec.begin();
	cout << "the num u wanto search" << endl;
	cin >> val;
	//cout << count(vec.begin(), vec.end(), val) << endl;
	cout << mystd::count(vec.begin(), vec.end(), val) << endl;
}